<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <link href="/assets/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link href="/assets/css/login.css" rel="stylesheet" type="text/css" />
    <link href="/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="/assets/css/components.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/assets/js/jquery.js"></script>
</head>
<body>
<div class="login">
    <div class="logo">
    </div>
    <div class="menu-toggler sidebar-toggler">
    </div>
    <div class="content">
        <div class="login-form">
            <h3 class="form-title">后台管理</h3>
            <div class="form-group">
                <label class="control-label visible-ie8 visible-ie9">用户名</label>
                <div class="input-icon">
                    <i class="fa fa-user"></i>
                    <input id="username" class="form-control placeholder-no-fix" type="text" placeholder="用户名" required>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label visible-ie8 visible-ie9">密码</label>
                <div class="input-icon">
                    <i class="fa fa-lock"></i>
                    <input id="password" type="password" class="form-control placeholder-no-fix" placeholder="密码">
                </div>
            </div>
            <div class="form-actions">
                <div id="login" class="btn blue pull-right">
                    登录 <i class="m-icon-swapright m-icon-white"></i>
                </div>
            </div>
        </div>
    </div>
    <div class="copyright">
        2015 © 杭州云复科技
    </div>
</div>

</body>
<script>
    $(document).ready(function() {
        if(window.sessionStorage) {} else {
            alert("浏览暂不支持sessionStorage");
            return;
        }
        $("#login").click(function() {
            valid();
        });

        function valid() {
            var blank = RegExp(/[(\ )]+/);
            //用户名
            var username = $("#username").val();
            if(username == "" || username.length == 0) {
                alert("账户不能为空");
                return false;
            }
            var password = $("#password").val();
            if(password == "") {
                alert("密码不能为空");
                return false;
            }
            if(blank.test(password)) {
                alert("密码不能为空格");
                return false;
            }
            submit();
        };

        function submit() {
            window.location.href = "/admin/index.html";
        }
    });
</script>

</html>